<script setup>
import { queryCategoryAll } from "@/api/category";
import { ref,onMounted } from "vue";

const getCategory  = async ()=>{
  const result = await queryCategoryAll()
  data.value = result.data
}

onMounted(()=>{
  getCategory()
})

const data = ref([])

//树型结构要加载的数据
const defaultProps = {
  children: 'children',
  label: 'name',
}

const handleNodeClick =()=>{}
</script>

<template> 
  <el-tree
    style="max-width: 600px"
    :data="data"
    :props="defaultProps"
    @node-click="handleNodeClick"
  />
</template>

<style scoped>
</style>